//
//  AppHeader.h
//  PlayCatchGame
//
//  Created by 流言 on 2018/1/15.
//  Copyright © 2018年 清正. All rights reserved.
//

#ifndef AppHeader_h
#define AppHeader_h

#import "UIImageView+WebCache.h"
#import "UIButton+WebCache.h"
#import "MJRefresh.h"
#import "MJExtension.h"
//监听网络
#import "Reachability.h"
#import "RequestManager.h"

#import "NSString+Other.h"
#import "UIView+Categoty.h"
#import "UIView+XLExtension.h"
#import "UIButton+Category.h"
#import "BMTextView.h"
#import "Masonry.h"
//标签
#import "PlatformTopView.h"
//提示
#import "AppToast.h"
#import "AlertBgView.h"
#import "JXTAlertManagerHeader.h"
#import "SRActionSheet.h"
//定时器
#import "TimerHandler.h"
//隐私权限
#import "PermissionTool.h"

// Base
#import "BaseModel.h"
#import "BaseView.h"
#import "BaseViewController.h"
#import "BaseTabBarController.h"
#import "BaseNavController.h"

#import "LoginViewController.h"
#import "QZMessageDetailVC.h"
#import "WebViewCell.h"

// 是否为iPhone 4
#define IS_IPHONE_4 (fabs((double)[[UIScreen mainScreen] bounds].size.height - (double)480) < DBL_EPSILON)

// 是否为iPhone 5
#define IS_IPHONE_5 (fabs((double)[[UIScreen mainScreen] bounds].size.height - (double)568) < DBL_EPSILON)

// 是否为iPhone 6
#define IS_IPHONE_6 (fabs((double)[[UIScreen mainScreen] bounds].size.height - (double)667) < DBL_EPSILON)

// 是否为iPhone Plus
#define IS_IPHONE_6PLUS (fabs((double)[[UIScreen mainScreen] bounds].size.height - (double)736) < DBL_EPSILON)

// 是否为iPhone X
#define IS_IPHONE_X (fabs((double)[[UIScreen mainScreen] bounds].size.height - (double)812) < DBL_EPSILON)


#define IS_IOS8_OR_GREATER (floor(NSFoundationVersionNumber) >= NSFoundationVersionNumber_iOS_8_0)

#define IS_IOS9_OR_GREATER (floor(NSFoundationVersionNumber) >= NSFoundationVersionNumber_iOS_9_0)

#define IS_IOS10_OR_GREATER (floor(NSFoundationVersionNumber) > NSFoundationVersionNumber_iOS_9_x_Max)


// 设置颜色
#define SET_RGB_COLOUR(R,G,B) [UIColor colorWithRed:(R)/255.0 green:(G)/255.0 blue:(B)/255.0 alpha:1.0]
// 默认颜色
#define APP_DEFAULT_COLOUR [UIColor colorWithRed:0.98 green:0.39 blue:0.25 alpha:1.00]
// 默认颜色
#define APP_DEFAULT_IMAGE [UIImage imageNamed:@"app_default_image"]

#define KScreenWidth [UIScreen mainScreen].bounds.size.width
#define KScreenHeight [UIScreen mainScreen].bounds.size.height
/**
 *  获取状态栏+导航栏高度
 *
 *  @param nav 导航视图
 *
 *  @return 高度
 */
static inline CGFloat getNavHeight(UINavigationController *nav) {
    
    //状态栏大小
    CGRect rectStatus = [[UIApplication sharedApplication] statusBarFrame];
    //导航栏大小
    CGRect rectNav = nav.navigationBar.frame;
    return CGRectGetHeight(rectStatus) + CGRectGetHeight(rectNav);
}

/// 通用 block
typedef void(^ButtonBlock)(UIButton *button);
typedef void(^TFChangeBlock)(UITextField *TF);
typedef void(^ViewBlock)(UIView *view);



/// 自定义打印
#ifdef DEBUG
#define NSLog( s, ... ) NSLog(@"<%p:%@>:第%d行  %@", self, [[NSString stringWithUTF8String:__FILE__] lastPathComponent], __LINE__, [NSString stringWithFormat:(s), ##__VA_ARGS__])
#else
#define NSLog( s, ... )
#endif

/// 是否有网
#define IS_NotReachable [[Reachability reachabilityWithHostName:@"www.baidu.com"] currentReachabilityStatus]==NotReachable

#define kLogoutSuccessNotification @"logoutSuccessNotification"     //退出登录通知
#define kLoginSuccessNotification  @"loginSuccessNotification"      //登录成功通知
// 记住账号密码的key
#define UserAccount @"UserAccount"
#define UserPassword @"UserPassword"
// 系统提示框(点击按钮无需处理)
#define ShowAlertTitle(message) jxt_showAlertTitleMessage(@"提示" ,(message))
// 请求结果成功处理
#define Request_Success [object[@"success"] boolValue]

// 请求地址
#define RequestBaseURL @"http://baidu.com"


#endif /* AppHeader_h */
